package net.llz;

import net.llz.adapter.cis.Adapter;
import net.llz.adapter.cis.TargetModule;
import net.llz.all_factory.FactoryProducer;
import net.llz.all_factory.OrderFactory;
import net.llz.builder.Computer;
import net.llz.builder.Director;
import net.llz.builder.HighComputerBuilder;
import net.llz.builder.LowComputerBuilder;
import net.llz.factory.Pay;
import net.llz.method.AliPayFactory;
import net.llz.method.PayFactory;

public class Main {
    public static void main(String[] args) {

        //简单工厂模式
//     Pay pay = SinplePayFactory.createPay("WECHAT_PAY");
//     pay.unifiedorder();

        //工厂方法模式
//        PayFactory ali =new AliPayFactory();
//        Pay pay= ali.getPay();
//        pay.unifiedorder();

        //抽象工厂模式
//
//        OrderFactory orderFactory = FactoryProducer.getFactory("ALI");
//        orderFactory.createPay().unifiedorder();
//        orderFactory.createRefund().refund();

        //建造着模式
//        Director director = new Director();
//
//        Computer lowComputer = director.craete(new LowComputerBuilder());
//
//        Computer highComputer = director.craete(new HighComputerBuilder());
//
//
//        System.out.println(lowComputer.toString());
//
//        System.out.println(highComputer.toString());


        TargetModule targetModule = new Adapter();

        targetModule.methodA();

        targetModule.methodB();

        targetModule.methodC();
    }
}
